<template>
  <div
    class="w-[100%]"
    style="height: calc(100% - 50px)"
    v-if="hasPerm(['system:druid'])"
  >
    <iframe class="w-[100%] h-[100%]" :src="druidUrl"></iframe>
  </div>
  <div
    class="w-[100%] flex items-center"
    style="height: calc(100% - 50px)"
    v-else
  >
    <a-empty>
      <template #image>
        <icon-close-circle-fill />
      </template>
      <span>暂无访问权限，请联系管理员分配权限</span>
    </a-empty>
  </div>
</template>
<script setup>
import { ref, onMounted } from "vue";
import { hasPerm } from "~/utils/sys.js";
import { druidLoginApi } from "../../../api/druid";

const druidUrl = ref("http://localhost:9091/minimalist/druid/login.html");

onMounted(() => {
  druidLoginApi({ ignore: 1 }).then(() => {
    druidUrl.value = "http://localhost:9091/minimalist/druid/index.html";
  });
});
</script>
<style scoped></style>
